﻿<Window x:Class="eDirectory.WPF.ExceptionNotifier.View.ExceptionNotifierView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Exception Notifier" Height="200" Width="500"
    WindowStartupLocation="CenterScreen"
    Loaded="WindowLoaded">


    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>           
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>           
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Grid.Column="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>                    
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Label Grid.Column="0" Grid.Row="0" Content="{Binding Path=TitleMessage}"/>            
            <Grid Grid.Column="0" Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="128"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Name="imgMsgType" Width="128" Height="Auto" Source="{Binding Path=ImageFilePath}">
                    <Image.Triggers>


                            <!-- Animates the rectangle's opacity. -->
                            <EventTrigger RoutedEvent="Image.Loaded">
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="imgMsgType"
                                          Storyboard.TargetProperty="Opacity"
                                          From="1.0" To="0.25" Duration="0:0:3" AutoReverse="True" RepeatBehavior="Forever" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </EventTrigger>

                    </Image.Triggers>
                </Image>
                <ScrollViewer Grid.Column="1" HorizontalScrollBarVisibility="Auto">
                    <TextBlock Grid.Column="1" Text="{Binding ExceptionMsg, Mode=OneWay}" IsEnabled="False"/>
                </ScrollViewer>
            </Grid>        
        </Grid>
        <StackPanel Height="Auto" Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="0">
            <Button Command="{Binding CopyCommand}">Copy to Clipboard</Button>
            <Button x:Name="btnClose" Command="{Binding CloseCommand}" IsCancel="True">Close</Button>
        </StackPanel>
    </Grid>
</Window>
